home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.0 / stk-3 / blt-for-STk-3.0 / Demos / htext.txt < prev    next >
Encoding:
Text File  |  1995-12-26  |  2.2 KB  |  61 lines

  1.         This is a (for lack of a better name) hypertext widget.
  2.  
  3. This widget combines text and other Tk widgets in the same window. 
  4. It is sort of a cross between a read-only text widget and the pack command.  
  5. Any widget can be attached to the hypertext window by the %%
  6. BEGIN
  7.   (label (& blt_htext{widget} ".lab") :text "append " 
  8.                                      :relief "sunken"
  9.                      :font "*-Courier-Bold-R-Normal-*-120-*")
  10.   ((eval blt_htext{widget}) 'append (& blt_htext{widget} ".lab"))
  11. %% command.
  12. For example, 
  13. %% BEGIN
  14.   (message (& blt_htext{widget} ".msg")  :relief "sunken"
  15.                          :bd 2 
  16.                      :aspect 10000 
  17.                      :font "*-Courier-Medium-R-Normal-*-120-*"
  18.                      :text "
  19. (define W w blt_htext{widget})
  20. (label (& W '.face) :bitmap \"@bitmaps/face\" 
  21.                 :relief \"sunken\" 
  22.                 :borderwidth 2)
  23. ((eval w) 'append (& W '.face) :padx 2 :pady 0.25i)
  24. ")
  25.    ((eval blt_htext{widget}) 'append (& blt_htext{widget} '.msg) :fill 'both)
  26. %% added this %%BEGIN
  27. (label (& blt_htext{widget} '.face)
  28.        :bitmap (& "@" *stk-library* "/images/face")
  29.        :relief 'sunken 
  30.        :borderwidth 2)
  31. ((eval blt_htext{widget}) 'append (& blt_htext{widget} '.face)
  32.                           :padx 2 :pady '0.25i :fill 'both)
  33. %%.
  34. There can be many types of widgets in the same document. For example,
  35. this is a simple %%BEGIN
  36. (button (& blt_htext{widget} '.but) :bg "pink" :text " button "
  37.     :command '(format #t "a stupid message\n")) 
  38. ((eval blt_htext{widget}) 'append (& blt_htext{widget} '.but))
  39. %%. If you click on the button, it prints a stupid message. 
  40. Any Tk widget can be used, including %% BEGIN
  41. (checkbutton (& blt_htext{widget} '.ckbut)
  42.          :bg "lightblue"
  43.          :text " check buttons "
  44.          :command '(format #t " check button pressed\n"))  
  45. ((eval blt_htext{widget}) 'append (& blt_htext{widget} '.ckbut))
  46. %%, %%BEGIN
  47. (radiobutton (& blt_htext{widget} '.rdbut)
  48.           :bg "mediumseagreen"
  49.           :text " radio buttons "
  50.           :command '(format #t " radio button pressed\n"))
  51. ((eval blt_htext{widget}) 'append (& blt_htext{widget} '.rdbut))
  52. %%, 
  53. and scales %%BEGIN
  54. (scale (& blt_htext{widget} '.sc) 
  55.        :showvalue #t
  56.        :length 100 
  57.        :sliderlength 10
  58.        :orient "horizontal")
  59. ((eval blt_htext{widget}) 'append (& blt_htext{widget} '.sc))
  60. %%.  
  61.